home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group95c.txt / 000079_icon-group-sender _Tue Nov 7 19:00:40 1995.msg < prev    next >
Internet Message Format  |  1996-01-03  |  1KB

  1. Received: by cheltenham.cs.arizona.edu; Wed, 8 Nov 1995 06:23:56 MST
  2. Date: Tue, 7 Nov 95 19:00:40 CST
  3. From: yak@comm.mot.com (Yarko Tymciurak)
  4. Message-Id: <9511080100.AA07218@platov8>
  5. To: icon-group@cs.arizona.edu
  6. Subject: Re:  Determining cursor position
  7. Errors-To: icon-group-errors@cs.arizona.edu
  8.  
  9. | Date: 07 Nov 95  15:01:41 GMT
  10. | From: R J Hare <rjhare@festival.ed.ac.uk>
  11. | Subject: Determining cursor position
  12. | To: icon-group@cs.arizona.edu
  13. | > If I have opened a window and written some text to it, how do I find
  14. | the x,y
  15. | > coordinates of the position immediately following the last character which I
  16. | > output?
  17. | > 
  18. | > Thanks.
  19. | > 
  20. | > Steve Graham
  21. | Me too! I was just about to send the message.
  22. | Is there a library routine which allows me  to convert columns & rows to x,y
  23. | positions?
  24. | Roger Hare
  25.  
  26. Example:
  27.  
  28.     link graphics
  29.     procedure main()
  30.  
  31.         WOpen()
  32.  
  33.         WWrites( "hello" )    # no new line; leaves cursor at end of "hello"
  34.  
  35.         x := WAttrib("x")    # captures canvas pixel coordinates
  36.         y := WAttrib("y")
  37.  
  38.         WWrite( "\nx = ", x, "\ny = ", y)
  39.  
  40.         WDone()
  41.  
  42.     end
  43.  
  44. See Appendix C of IPD255 for more info.
  45.  
  46.  
  47. Yarko
  48.